'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  //房源管理
  //获取
  router.get('/api/Gethome', controller.home.gethome);
  //删除
  router.delete('/api/Deletehome', controller.home.deletehome);
  //新增
  router.post('/api/addHome', controller.home.addhome);
  //编辑
  router.put('/api/editorHome', controller.home.editorhome);
  //状态的开关
  router.put('/api/stateHome', controller.home.statehome);
  //搜索
  router.get('/api/searchHome', controller.home.searchhome);

  //经纪人管理
  //获取
  router.get('/api/Getbroker', controller.broker.getbroker);
  //删除
  router.delete('/api/Deletebroker', controller.broker.deletebroker);
  //新增
  router.post('/api/addbroker', controller.broker.addbroker);
  //编辑
  router.put('/api/editorbroker', controller.broker.editorbroker);
  //搜索
  router.get('/api/searchbroker', controller.broker.searchbroker);
  //启用
  router.put('/api/statebroker', controller.broker.statebroker);


  //资讯管理
  //获取
  router.get('/api/GetInfomation', controller.infomation.getInfomation);
  //删除
  router.delete('/api/DeleteInfomation', controller.infomation.deleteInfomation);
  //新增
  router.post('/api/addInfomation', controller.infomation.addInfomation);
  //编辑
  router.put('/api/editorInfomation', controller.infomation.editorInfomation);
  //搜索
  router.get('/api/searchInfomation', controller.infomation.searchInfomation);
  //开关
  router.put('/api/stateInfomation', controller.infomation.stateInfomation);

  //团购管理
  //获取
  router.get('/api/GetGroup', controller.group.getGroup);
  //删除
  router.delete('/api/DeleteGroup', controller.group.deleteGroup);
  //搜索
  router.get('/api/searchGroup', controller.group.searchGroup);
  //开关
  router.put('/api/stateGroup', controller.group.stateGroup);

  //直播管理
  //获取
  router.get('/api/GetLook', controller.look.getLook);
  //删除
  router.delete('/api/DeleteLook', controller.look.deleteLook);
  //搜索
  router.get('/api/searchLook', controller.look.searchLook);
  //开关
  router.put('/api/stateLook', controller.look.stateLook);

  //审核管理
  //获取
  router.get('/api/GetCheck', controller.check.getCheck);
  //删除
  router.delete('/api/DeleteCheck', controller.check.deleteCheck);
  //搜索
  router.get('/api/searchCheck', controller.check.searchCheck);
  //开关
  router.put('/api/stateCheck', controller.check.stateCheck);
  //编辑
  router.put('/api/editorCheck', controller.check.editorCheck);

  //订单管理
  //获取
  router.get('/api/GetIdent', controller.ident.getIdent);
  //删除
  router.delete('/api/DeleteIdent', controller.ident.deleteIdent);
  //搜索
  router.get('/api/searchIdent', controller.ident.searchIdent);
};
